#ifndef DYN_QUAD_QTRAP_H
#define DYN_QUAD_QTRAP_H

#include "dyn_quad.h"
#include "dyn_trapzDriver.h"

/*! \author Joey  Dumont
 *
 *  \date 2012-10-05
 *
 *  \brief Provides a simple trapezoid rule quadrature algorithm.
 *
 * This is the simplest integrator there is. Given a tolerance,
 * it computes successive refinements of the trapezoid rule
 * until convergence. A maximum number of iterations is allowed.
 */

class qTrap : public Quad
{
public:
    /*! Constructor defines the basic variables, along
     * with the maximum number of iterations allowed. */
    qTrap(Functor& _func,
          double _a,
          double _b,
          double _tol,
          int _maxIterations);

    /*! @name Accessor Functions. */
    //@{
    int getMaxIterations(){return maxIterations;}
    void setMaxIterations(int _maxIterations){maxIterations=_maxIterations;}

    /*! Re-declared pure virtual function. */
    double doQuadrature();

protected:
    int maxIterations;
};

#endif // DYN_QUAD_QTRAP_H
